package components
{
	import UIFree.uif_component;
	
	import flash.geom.Rectangle;

	public class clt_layer extends clt_component {
		public static const ALIGNTOP		: String = 'ALIGNTOP';
		public static const ALIGNBOTTOM		: String = 'ALIGNBOTTOM';
		protected static var _cur_pos		: Array = [-1, -1];
		public function clt_layer(parent	: uif_component, a_height: int, align: String=ALIGNTOP, styleClass:String='') {
			var ly		: Number;
			var inner	: Rectangle = parent.getInner();
			if (_cur_pos[0] == -1) {
				_cur_pos[0] = inner.y;
				_cur_pos[1] = inner.y + inner.height;
			}
			if (align == ALIGNTOP) ly = _cur_pos[0];
			else  ly = _cur_pos[1] - a_height; 
			super(parent, inner.x, ly, inner.width, a_height, styleClass);
			if (align == ALIGNTOP) _cur_pos[0] += a_height;
			else  _cur_pos[1] -= a_height; 
		}
	}
}